function PadZero(str) {
      //补零
      return new RegExp(/^\d$/g).test(str) ? `0${str}` : str;
}

export function formatTime(_seconds) {
      _seconds = parseInt(_seconds, 10);
      let hours, mins, seconds;
      let result = '';
      seconds = parseInt(_seconds % 60, 10);
      mins = parseInt(_seconds % 3600 / 60, 10)
      hours = parseInt(_seconds / 3600, 10);

      if (hours)
            result = `${PadZero(hours)}:${PadZero(mins)}:${PadZero(seconds)}`
      else
            result = `${PadZero(mins)}:${PadZero(seconds)}`
      return result;
}
